﻿using NUnit.Framework;
using Rhino.Mocks;

namespace Utilities.Testing
{
  [TestFixture]
  public abstract class TestFixtureBase
  {
    private MockRepository _repository;

    public MockRepository Repository
    {
      get
      {
        if (_repository == null)
          _repository = new MockRepository();

        return _repository;
      }
    }

    [TestFixtureSetUp]
    public virtual void FixtureSetup()
    {
    }

    [TestFixtureTearDown]
    public virtual void FixtureTearDown()
    {
    }

    [SetUp]
    public virtual void TestSetup()
    {
    }

    [TearDown]
    public virtual void TestTearDown()
    {
      // ensure each test has a clean mock repository
      _repository = null;
    }
  }
}